package com.example.oasystem.dao.position;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.example.oasystem.entity.dept.AoaDept;
import com.example.oasystem.entity.position.AoaPosition;
import com.example.oasystem.entity.user.AoaUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface AoaPositionDao extends BaseMapper<AoaPosition> {

    List<AoaPosition> selectByDeptId(long selectdeptid);

    int deleteByPrimaryKey(Long positionId);

/*    int insert(AoaPosition record);*/

    int insertSelective(AoaPosition record);

    AoaPosition selectByPrimaryKey(Long positionId);

    int updateByPrimaryKeySelective(AoaPosition record);

    int updateByPrimaryKey(AoaPosition record);

    List<AoaPosition> aoaPosition(String name);

    @Select("select*from aoa_dept where dept_id =#{deptId}")
    AoaDept aoaDept(Long deptId);

    @Select("select*from aoa_dept")
    List<AoaDept> aoaDepts();

    @Select("select*from aoa_user where position_id=#{positionId}")
    List<AoaUser>users(Long positionId);

    List<AoaPosition> paginationPosition(String name,int number,int size);

    List<AoaPosition> selectAllPositions();

    List<AoaPosition> selectByDeptIdOnDept(Long deptid);
}